package com.xr.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.xr.constant.MessageConstant;
import com.xr.pojo.Permission;
import com.xr.result.Result;
import com.xr.service.PermissionService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("permission")
public class PermissionController {

    @Reference
    private PermissionService permissionService;

    @RequestMapping("/findAll")
    public Result findAll(){
        try {
            List<Permission> list = permissionService.findAll();
            return new Result(true, MessageConstant.QUERY_CHECKITEM_SUCCESS,list);

        }catch(Exception e){
            e.printStackTrace();
        }
        return new Result(false, MessageConstant.QUERY_CHECKITEM_FAIL);
    }
}
